﻿$(document).ready(function() {
    try {
        window.alert = window.jqalert;
    } catch (err) {
        //window.alert('Your browser does not support overloading window.alert.' + err);
    }

    $(".StarRating .star").click(function() {
        $("#selectedRating").val($(this).text());
    });
    reloadRating();

    $(".StarRating").click(function() {
        //alert(tabUrl);
        if ($(this).children().hasClass("star_readonly")) {
            var meta = $(this).metadata();
            var Url = "/" + tabUrl + "/" + meta.ideaId + "/Feedback/Submit";
            window.location.href = Url;
        }
    });

    $(".facebook").click(function() {
        //jqalert('This feature not implemented in this version', '', { modal: false });
        jqalert('This feature has not been implemented in this version', '',
        jqalerter.getDefaultOptions()
        .setOption('dynamicCss', false)
        .setOption('modal', false),
        $("#windowElementDemo")[0]);

    });
    $(".twitter").click(function() {
        jqalert('This feature has not been implemented in this version', '',
        jqalerter.getDefaultOptions()
        .setOption('dynamicCss', false)
        .setOption('modal', false),
        $("#windowElementDemo")[0]);
    });
    $(".digg").click(function() {
        jqalert('This feature has not been implemented in this version', '',
        jqalerter.getDefaultOptions()
        .setOption('dynamicCss', false)
        .setOption('modal', false),
        $("#windowElementDemo")[0]);
    });

});

function reloadRating() {
	try {
		$("input[@type=radio].star").rating(); //***Code for Initializing rating...
	}
	catch (e) { alert(e); }
}
